Completed
Push — dev ( 6ada4c...6e0845 )
by Fike
31s
created

Objects.spec.js ➔ describe(ꞌUnitꞌ)   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 28

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 28
rs 8.8571
1
/* eslint-env mocha */
2
/* global allure */
3
4
var Chai = require('chai')
5
var expect = Chai.expect
6
7
var Objects = require('../../../../lib/Utility/Objects').Objects
8
9
describe('Unit', function () {
10
  describe('/Utility', function () {
11
    describe('/Objects.js', function () {
12
      describe('.Objects', function () {
13
        describe('.copy', function () {
14
          var variants = [1, 1.0, true, false, null, undefined, 'string']
15
          variants.forEach(function (value) {
16
            it('passes through primitive value', function () {
17
              allure.addArgument('input', value)
18
              expect(Objects.copy(value)).to.equal(value)
19
            })
20
          })
21
22
          it('copies array contents', function () {
23
            var value = [1, 2, 3]
24
            var copy = Objects.copy(value)
25
            expect(copy).not.to.equal(value)
26
            expect(copy).to.deep.eq(value)
27
          })
28
        })
29
30
        describe('.merge', function () {
31
          // TODO: write tests for all cases
32
        })
33
      })
34
    })
35
  })
36
})
37